package com.ruyuan.commodity.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruyuan.commodity.model.goodssearch.SearchKeywordDO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
 * SearchKeyword的Mapper
 */
@Repository
public interface SearchKeywordMapper extends BaseMapper<SearchKeywordDO> {

    /**
     * 更新搜索分词数量
     * @param dateline 时间
     * @param keyword 分词
     */
    @Update("update es_keyword_search_history set count = count + 1, modify_time = #{time} where keyword = #{keyword}")
    void updateKeywordCount(@Param("time") long dateline, @Param("keyword") String keyword);
}
